package com.boxin.ims.modules.wechat.ad.utils;

import java.util.List;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Service;

import com.boxin.ims.modules.ad.entity.Advertisement;
import com.boxin.ims.modules.ad.service.AdvertisementService;
import com.boxin.ims.modules.wechat.entity.LotteryRecord;
import com.boxin.ims.modules.wechat.entity.WechatMember;
import com.thinkgem.jeesite.modules.sys.entity.User;

/**
 * @author Administrator
 * @date 2014-4-21
 * @function <p></p>
 */
@Service
public class AdvertisementUtils  implements ApplicationContextAware {

	private static AdvertisementService advertisementService;
	
	
	@Override
	public void setApplicationContext(ApplicationContext applicationContext)
			throws BeansException {
		
		advertisementService = (AdvertisementService)applicationContext.getBean("advertisementService");
		
	}
	
	/**
	 * @author Jakemanse
	 * @time 2014-4-21  上午10:38:52
	 * @function <p>广告商---被投放者的广告  </p>
	 * @param userId
	 * @return
	 */
	public static List<Advertisement> findMyAddvertisementList(Long userId){
		List<Advertisement> adList = advertisementService.findSellerAdList(userId);
		return adList;
		
	}
	
	
	/**
	 * @author Jakemanse
	 * @time 2014-4-22  上午10:14:47
	 * @function <p>  </p>
	 * @param user
	 * @param member
	 * @return
	 */
	public static List<LotteryRecord> findMyAdvertisementLotteryList(User user,WechatMember member){
		
		List<LotteryRecord> lotteryList = advertisementService.findMyAdvertisementLotteryList(user,member);
		return lotteryList;
		
	}
	
	
	
	
	
	

}
